package com.lantosec.hmrp.modules.category.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsImageVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * 资产图片上传记录 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsImage extends BaseEntity<AssetsImageVO> {

    private static final long serialVersionUID = 1L;
    public AssetsImage(AssetsImageVO vo){
        this.assetsId = vo.getAssetsId();
        this.uploadId = vo.getUploadId();
        this.submitTime = vo.getSubmitTime();
        this.submitUserId = vo.getSubmitUserId();
        this.submitUser = vo.getSubmitUser();
        this.flag = vo.getFlag();
    }

    @Override
    public AssetsImageVO convertToVO(){
        return new AssetsImageVO(this);
    }


    /**
     * 资产ID
     */
    @TableId(value = "assets_id", type = IdType.ASSIGN_UUID)
    private String assetsId;

    /**
     * 上传表ID
     */
    private String uploadId;

    /**
     * 上传时间
     */
    private Date submitTime;

    /**
     * 上传时间
     */
    private String submitUserId;

    /**
     * 上传时间
     */
    private String submitUser;

    @TableField(exist = false)
    private String flag;


    public enum ColName {
        assets_id, upload_id, submit_time, 
    }
}
